package com.net.oil.oilWear.presenter;

import com.net.oil.base.BasePresenter;
import com.net.oil.oilWear.bean.FillOilRecordBean;
import com.net.oil.oilWear.contract.FillOilRecordContract;
import com.net.oil.oilWear.model.FillOilRecordModel;

/**
 * 作者：lch
 * 时间：2019/1/19 0019:下午 22:08
 * 邮箱：245850413@qq.com
 * 说明：
 */
public class FillOilRecordPresenter extends BasePresenter<FillOilRecordContract.View> implements FillOilRecordContract.Presenter {

    private FillOilRecordContract.View view;
    private FillOilRecordContract.Model model;

    public FillOilRecordPresenter(FillOilRecordContract.View view) {
        this.view = view;
        model = new FillOilRecordModel(this);
    }

    @Override
    protected void unSubscribe() {
        model.unSubscribe();
    }

    @Override
    public void getFillOilRecord(int carId, int page) {
        model.getFillOilRecord(carId, page);
    }

    @Override
    public void getFillOilRecordSuccess(FillOilRecordBean fillOilRecordBean) {
        view.getFillOilRecordSuccess(fillOilRecordBean);
    }

    @Override
    public void getFillOilRecordFailed() {
        view.getFillOilRecordFailed();
    }

    @Override
    public void deleteFillOilRecord(int id) {
        model.deleteFillOilRecord(id);
    }

    @Override
    public void deleteFillOilRecordSuccess() {
        view.deleteFillOilRecordSuccess();
    }

    @Override
    public void deleteFillOilRecordFailed() {
        view.deleteFillOilRecordFailed();
    }
}
